package src.com.doit.demo04;

import java.util.Iterator;
import java.util.Properties;
import java.util.Set;

public class test_Property {
    public static void main(String[] args) {
        Properties p =new Properties();
        p.setProperty("眼","12");
        p.setProperty("耳","15");
        p.setProperty("口","16");
        p.setProperty("鼻","19");

        System.out.println(p.getProperty("鼻"));//只能根据键去找值

        Set<String> strings = p.stringPropertyNames();

        for (String s : strings)
        {
            String value = p.getProperty(s);
            System.out.println(s+" "+value);
        }//无序唯一

        Iterator<String> it = strings.iterator();
        while (it.hasNext())
        {
            String next = it.next();
            System.out.println(next+p.getProperty(next));
        }
    }
}
